package states.gameplay.shapors;


public abstract class Defender extends Shapor {

	private int _attackRadius;
	private int timeToNextAttack;
	
	public Defender(int deployLimits, 
						 int cost, 
						 int deployPulses, 
						 int energyUpkeep,
						 int attackRadius,
						 int timeToNextAttack) {
		super(deployLimits, cost, deployPulses, 0, energyUpkeep);
		
		_attackRadius = attackRadius;
		
		setTimeToNextAttack(timeToNextAttack);
	}

	public int getAttackRadius() {
		return _attackRadius;
	}

	public int getTimeToNextAttack() {
		return timeToNextAttack;
	}

	public void setTimeToNextAttack(int time) {
		this.timeToNextAttack = time;
		
		if ( timeToNextAttack < 0 ){
			timeToNextAttack = 0;
		}
	}
	
	public void updateTimeToNexAttack(int delta){
		this.timeToNextAttack -= delta;
		
		if ( timeToNextAttack < 0 ){
			timeToNextAttack = 0;
		}
	}

}
